<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2021.3.22
 * Time: 10:34
 */

function cube($n) {
    return $n * 2;
}

$a = [1,2,3,4];
print_r(array_map('cube',$a));